<template>
<div>
  <div class="bianji">
        <van-icon name="arrow-left" @click="$router.go(-1)"/>
      <h1>新增客户信息</h1>
      <van-icon name="wap-home-o" />
    </div>
    <div class="bianjilist">
        <ul>
            <li>  <span>客户姓名:</span> <input v-model="custName"></li>
            <li> <span>联系方式:</span> <input v-model="telephone"></li>
            <li>学历: <input v-model="education"></li>
            <li>年龄: <input v-model="age"></li>
            <li>性别: <input v-model="sex"></li>
            <li>所属城市: <input v-model="cityName"></li>
            <li>公司名称: <input v-model="company"></li>
            <li>职务: <input v-model="position"></li>
        </ul>
    </div>
    <div class="xiugai" @click="biaji">
        <span>保存</span>
    </div>
</div>
  
</template>

<script>
import {GetBianjiDate,GetCUstDate} from "@/request/api"
export default {
    name:"Newcustomerinformation",
    data () {
        return {
         custName:'',
         cityName:"",
         company:"",
         position:'',
         telephone:'',
         education:'',
         sex:'',
         age:''
 
        }
    },
    methods:{
        biaji(){
            GetCUstDate({
                custName:this.custName,
         cityName:this.cityName,
         company:this.company,
         position:this.position,
         telephone:this.telephone,
         education:this.education,
         sex:this.sex,
         age:this.age,
        
            }).then((res)=>{
                if(res.data.errCode==0){
                     this.$toast('新增成功');
                     setTimeout(()=>{
 this.$router.push("/myclients")
                     },1000)
                   
                }else{

                }
            console.log("新增客户成功的数据:",res);
            })
        }
    }
}
</script>
 
<style lang = "less" scoped>
    .bianji{
        height: .5rem;
        line-height: .5rem;
        display: flex;
        align-items: center;
        font-size: .15rem;
          background-color: #003499;
          color: white;
          padding: 0 .15rem;
        h1{
            flex: 1;
            text-align: center;
          
        }
    }
    .bianjilist{

        font-size: .14rem;
        background: #fff;
        padding: 0 .15rem;
        ul{
            li{
                height: .5rem;
    line-height: .5rem;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-around;
      input{
            height: .4rem;
            border: none;
        }

            }
        }
    }
    .xiugai{
        padding: .1rem 0;
        span{
           display: block;
    color: white;
    font-size: 0.14rem;
    width: 3.5rem;
    border-radius: .15rem;
    height: 0.4rem;
    background: #003499;
    line-height: 0.4rem;
    margin: 0 auto;
    text-align: center;
        }
      
    }
</style>